﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "VisibilityTypeEnums.h"
#include "IDbObject.h"

namespace gcmp
{
    /// \brief 可见性类型标记接口类
    ///
    class GCMP_MODEL_INTERFACE_EXPORT IVisibilityTypeFlags : public IDbObject
    {
        DEFINE_CAST_DERIVED(IVisibilityTypeFlags, IDbObject)

    public:

        /// \brief 构造函数，默认任何情况下都可见
        ///
        /// \return 返回可见性类型标记的指针。返回类型为OwnerPtr<IVisibilityTypeFlag>
        static OwnerPtr<IVisibilityTypeFlags> Create();

        /// \brief 根据枚举类型构造对象
        /// \param type 可见性类型
        /// \return 返回可见性类型标记的指针。返回类型为OwnerPtr<IVisibilityTypeFlag>
        static OwnerPtr<IVisibilityTypeFlags> Create(VisibilityType type);

        /// \brief 根据UInt32类型构造对象
        /// \param flag 标记值
        /// \return 返回可见性类型标记的指针。返回类型为OwnerPtr<IVisibilityTypeFlag>
        static OwnerPtr<IVisibilityTypeFlags> Create(UInt32 flag);

        /// \brief 设置标记值
        ///
        /// \param flag 标记值
        virtual void SetFlags(UInt32 flag) = 0;

        /// \brief 添加标记，将相关标记位置1
        ///
        /// \param type 可见性类型
        virtual void AddFlag(VisibilityType type) = 0;

        /// \brief 根据可见性类型将相关标记位置0
        ///
        /// \param type 可见性类型
        virtual void RemoveFlag(VisibilityType type) = 0;

        /// \brief 重置标记，所有标记位置1
        ///
        virtual void Reset() = 0;

        /// \brief 清除标记，所有标记位置0
        ///
        virtual void Clear() = 0;

        /// \brief 根据可见性类型，测试标记位是否置1
        ///
        /// \return 置1返回true，置0返回false
        virtual bool Test(VisibilityType type) const = 0;

        /// \brief 获取标记值
        ///
        /// \return 返回标记值
        virtual UInt32 GetFlags() const = 0;
        
        /// \brief 克隆方法
        ///
        /// \return 克隆一份当前对象并返回。返回类型为OwnerPtr<IVisibilityTypeFlag>
        virtual OwnerPtr<IVisibilityTypeFlags> Clone() const = 0;

        /// \brief 析构器
        virtual ~IVisibilityTypeFlags();
    };

}




